<template>
  <div>
    <el-form :inline="true" :model="user" class="demo-form-inline">
      <el-form-item label="手机号">
        <el-input v-model="user.phone" placeholder="手机号"></el-input>
        <el-button @click="send">发送</el-button>
      </el-form-item><br>
      <el-form-item label="验证码">
        <el-input  v-model="user.code" placeholder="验证码"></el-input>
      </el-form-item><br>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">下一步</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "Login",
  data() {
    return{
      oauth2Url:null,
      code:null,
      user:{}
    }
  },
  created() {
  },
  methods:{
    send() {
      if (this.user.phone==null) {
        this.$message.error("手机号不能为空")
        return
      }
      this.axios.get("http://localhost:8080/system/sms/send/"+this.user.phone).then(
          res=>{
              this.$message.success(res.data.msg)
          }
      )
    },
    onSubmit() {
      if (this.user.code==null) {
        return
      }
      this.$router.push("/addMerchant");
    }
  }
}
</script>

<style scoped>

</style>
